#pragma once

class LogManagement;
class LogInputHandler : public IEventHandler
{
public:
					LogInputHandler(LogManagement* manager);
										

	virtual bool	IsEnabled()				{return true;}
	virtual void	OnEvent(Event* evt);

private:
	LogManagement*		m_logManager;
};

class Logger;
class ConsoleLogger;
class InputKeyEvent;
class FrameUpdatedEvent;
class Ogre::LogListener;
class LogManagement : public Ogre::LogListener
{
	// TODO : Only One Instance
public:
							LogManagement();
							~LogManagement();
	
	void					Write(const char* fmt, ...);

	void					UpdateKey(InputKeyEvent* evt);

	bool					AddFilter(const char* str, uint len);
	bool					DelFilter(const char* str, uint len);
	void					ClearFilter();

	bool					IsFilter(const char* str, uint len);

public:
	void					LogInit();
	void					LogShutdown();

public:
	bool					IsConsoleVisible();
	void					SetConsoleVisible(bool visible);
	
	void					ConsoleUpdate(FrameUpdatedEvent* evt);

public:
	virtual void			messageLogged(const String& message, LogMessageLevel lml, 
												bool maskDebug, const String &logName);

private:
	LogInputHandler*		m_LogInputHandler;
	ConsoleLogger*			m_ConsoleLogger;

	std::vector<Logger*>	m_LoggerList;
	std::vector<u16>		m_Filters;
};

